CachedSharePointFile Constructor (SharePointCacheSettings, SharePointFileLocation, bool)

Create a representation of a file in SharePoint, running with elevated privileges when accessing the SharePoint file.

Parent Type: CachedSharePointFile

Namespace: Microsoft.LearningComponents.SharePoint

Assembly: Microsoft.LearningComponents.SharePoint.dll

Syntax
C#

public CachedSharePointFile (
SharePointCacheSettings cacheSettings,
SharePointFileLocation location,
bool runWithElevatedPrivileges

)

Parameters

cacheSettings

The settings that determine how the file is cached.

location

The location of the file in SharePoint.

runWithElevatedPrivileges

If true, SharePoint file will be accessed using elevated privileges.

Exceptions
Exception type Condition
UnauthorizedAccessException

Thrown if the settings.WindowsIdentity does not have appropriate permissions to the settings.CachePath folder.

Remarks

This method does only verifies that the settings.WindowsIdentity has access to the settings.CachePath. It does not verify that the file exists in SharePoint. The contents of the package are read only once when they are first needed.